<html xml:lang="en" lang="en">
    <head>
        <link rel="stylesheet" href="<?php echo Yii::app()->theme->baseUrl?>/styles/form.css" type="text/css" media="screen" />
        <link rel="stylesheet" href="<?php echo Yii::app()->theme->baseUrl?>/styles/login.css" type="text/css" media="screen" />
        <?php Yii::app()->ClientScript->registerCoreScript('jquery'); ?>
    </head>
    
    <body>
    	<!--login. Start-->	    
		<div class="login">
        <h1><a href="index.php"><img border="0" src="<?php echo Yii::app()->theme->baseUrl?>/images/serta-logo.png"></a></h1>
        <?php
            $form=$this->beginWidget('CActiveForm', array(
                'id'=>'login',
                'enableClientValidation'=>true,
                'clientOptions'=>array(
                    'validateOnSubmit'=>true,
                ),
                'htmlOptions'=>array(
                    'class'=>'form',
                ),
                'focus'=>array($user, 'email'),
            ));
        ?>
        <h2>Login with your username and password below:</h2>
        <div class="row">
            <label for="<?php echo CHtml::getActiveId($user, 'email');?>">Email</label>
            <?php echo $form->textField($user, 'email'); ?>
            <?php echo $form->error($user,'email'); ?>
        </div>
        <div class="row">
            <label for="<?php echo CHtml::getActiveId($user, 'password');?>">Password</label>
            <?php echo $form->passwordField($user, 'password'); ?>
            <?php echo $form->error($user,'password'); ?>
        </div>
        <div class="remember">
            <input type="checkbox" name="remember" id="remember" />
            <label><a onclick="CheckRemember();">Remember me on this computer</a></label>
        </div>
        <div class="row buttons">
            <?php echo CHtml::submitButton('Sign in', array('class' => 'Button'));
                    echo FHtml::link('Forgot password', $this->createUrl('/Core/user/forgotPassword'), array('class' => 'ForgotPassword', 'title' => 'Forgot password'));
            ?>
        </div>   
        <?php $this->endWidget(); ?>
        </div>
    	<!--login. Close-->
    </body>
    <script>
    function CheckRemember()
    {
        if ($('#remember').attr('checked'))
            $('#remember').attr('checked', false);
        else
            $('#remember').attr('checked', true);
    }
    </script>
    <script type="text/javascript">        
        function sizeBox() {
            var w = $(window).width();
            var h = document.getElementsByTagName('html')[0].clientHeight
            $('.login').css('position', 'absolute');
            $('.login').css('top', h/2-($('.login').height()/2)-50);
            $('.login').css('left', w/2-($('.login').width()/2));
        }

        $(document).ready(function() {
            sizeBox();            
        });

        $(window).resize(function() {
            sizeBox();
        });

    </script>
</html>	